<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
  	<div>
		<div style="display:none">
	    	
	    </div>
	    
	   
 	<!-- 客户基本信息 -->
  	<form id="roomTop" method="post" action="project/decorateScheme/addDecorateVerify">
  	
		<!-- 房间类型 -->
		<input type="text" name="roomType"id="roomType" value="${roomType}" hidden="hidden"/>
		<!-- 房间号 	预留-->
		<input type="text" name="fkroomId" value="" hidden="hidden" />
		<!-- 客户 	预留-->
		<input type="text" name="fkcustomerId" hidden="hidden" />
		<!-- 验收位置  0：四壁  1：顶   2：地面-->
  		<input type="text" name="verifySite" value="1" hidden="hidden" />
		<!-- 房号、客户  替换上面房号客户 -->
		<div style="padding:10px 0px">
			<b style="padding:0px 50px 0px 0"><span>房号&nbsp;&nbsp;</span>
			<button class="btn btn-primary radius" type="submit">选择</button></b> <b><span>客户&nbsp;&nbsp;</span>
			<button class="btn btn-primary radius" type="submit">选择</button></b>
			&nbsp;&nbsp;房屋类型：${roomType}
		</div>
		
		<div>
			<div class="panel panel-default">
	   			<div class="panel-body ">
					<table cellpadding="10" cellspacing="5"  class="mytable">
						<tr>
							<td>
								 <!-- 附件上传 -->
								<jsp:include page="../../p_utilePage/Article1.jsp"></jsp:include>
							</td>
						</tr>
				    </table>
				</div>
			</div>
		</div>
			
		<div style="width:100%;text-align:center; padding-top:20px"> 
			<button class="btn btn-primary radius" type="submit" > 保 存</button> 
			 <a class="btn btn-default radius" onClick="closeIframe('gridObj');"> 取 消 </a> 
	    	  <br/><br/>
    	</div> 
	</form>
	<script type="text/javascript">
		$(function(){
			//为指定附件上面添加文本框
			var $tr=$("#roomTop table tr");
			$tr.each(function(i,v){//before()
				var td=$(v).children("td").eq(0);
				var text=td.text();
				var $v=$(v);
				if(text=="照明图片"){
					var $tag=$("<tr><td>照明</td><td><input type=\"text\" name=\"illumination\" /></td></tr>");
					$v.before($tag);
				}else if(text=="喷淋"){
					var $tag=$("<tr><td>装饰材料</td><td><input type=\"text\" name=\"decorateMaterials\" /></td></tr>");
					$v.before($tag);
				}
			});
			showProof();
		});
		
		//隐藏字段
		function showProof(){
			var roomType = '${roomType}';
			$tr=$("#roomTop table tr");
			if(roomType=="起居室" || roomType=="玄关" || roomType=="阳台"){
				var arr = ["新风出口","回风口","浴霸","排风扇","吊顶","晾衣杆"];
				for(var i=0;i<arr.length;i++){
					eachRemove(arr[i]);
				}
			}else if(roomType=="餐厅" || roomType=="厨房" || roomType=="储物间"){
				var arr = ["浴霸","排风扇","吊顶","晾衣杆"];
				for(var i=0;i<arr.length;i++){
					eachRemove(arr[i]);
				}
			}else if(roomType=="卫生间"){
				var arr = ["新风出口","回风口","吊顶","晾衣杆"];
				for(var i=0;i<arr.length;i++){
					eachRemove(arr[i]);
				}
			}else if(roomType=="阳台"){
				var arr = ["新风出口","回风口","浴霸","排风扇","灯池"];
				for(var i=0;i<arr.length;i++){
					eachRemove(arr[i]);
				}
			}else if(roomType=="房间"){
				var arr = ["浴霸","排风扇","吊顶","晾衣杆"];
				for(var i=0;i<arr.length;i++){
					eachRemove(arr[i]);
				}
			}
		}
		
		function eachRemove(arr){
			//for(var j=0;j<arr.length;i++){
				$tr.each(function(i,v){//before()
					var td=$(v).children("td").eq(0);
					var text=td.text();
					var $v=$(v);
					if(text==arr){
						$v.remove();
					}
				});
			//}
		}
	</script>
	
	</div>

